{% extends 'layout.html' %}
<!--
继承+重写
-->
{%block main%}

<div class="blog-container">
    <div class="">内容管理页面</div>
    <div>当前用户：{{userinfo.username}}（{{userinfo._id}}）</div>
    <h3>文章列表</h3>
    <div>
        <table class="blog-table">
            <tr>
                <th style="width: 15%">文章标题</th>
                <th style="width: 10%">文章分类</th>
                <th style="width: 10%">文章简介</th>
                <th style="width: 10%">作者</th>
                <th style="width: 15%">修改时间</th>
                <th style="width: 5%">阅读量</th>
                <th style="width: 25%">文章内容</th>
                <th style="width: 10%">操作</th>
            </tr>
        {%for item in content%}
            <tr>
                <td><span>{{item.title}}</span></td>
                <td><span>{{item.category.name.toString()}}</span></td>
                <td><span>{{item.distribution}}</span></td>

                <td><span>{{item.user.username}}</span></td>
                <td><span>{{item.addTime|date('Y年m月d日 h:i:s',-8*60)}}</span></td>
                <td><span>{{item.views}}</span></td>

                <td><span>{{item.content}}</span></td>
                <td>
                    <a href="/admin/content/edit?id={{item._id.toString()}}">编辑</a>
                    <a href="/admin/content/delete?id={{item._id.toString()}}">删除</a>
                </td>
            </tr>
        {%endfor%}
        </table>
    </div>
</div>
{%endblock%}

